import provide from "@common/mixins/provide";

export default {
    ...provide,
    props: {
        dialog: {
            type: Boolean,
            default: true,
        },
    },
    data() {
        const _this = this;
        return {
            clientOptions: {
                disabled: false,
                placeholder: '请选择客户',
                props: {
                    value: 'sid',
                    label: 'display',
                },
                bottomAction: {
                    permission: 'jxc:relatedParty:save',
                    permissionUrl: '/jxcBaseRelated',
                },
            },
            supplierOptions: {
                disabled: true,
                placeholder: '请选择供应商',
                props: {
                    value: 'sid',
                    label: 'display',
                },
                bottomAction: {
                    permission: 'jxc:relatedParty:save',
                    permissionUrl: '/jxcBaseRelated',
                },
            },
            personSelectProps: {
                remote: _this.$api.API_FindSysGroupPersonsByAuth,
                optionProps: {
                    label: 'name',
                    value: 'sid',
                },
            },
        };
    },
    methods: {
        contractionClick(tableRef) {
            return () => {
                this.$nextTick(() => {
                    this.$refs[tableRef] && this.$refs[tableRef].resizeTable();
                });
            };
        },
        back(toPath, refreshEmit) {
            this.$bus.$emit('close_tags', this.$route.fullPath);
            this.$router.push(toPath);
            if (this.$utils.isNotEmpty(refreshEmit)) {
                this.$bus.$emit(refreshEmit);
            }
        },
    },
}
